Namespace Producto
Public Class Catalogo
	Inherits Auditoria.Transaccion

	Private vCatalogoId As Integer = -1
	Private vCodigo As String = ""
	Private vNombre As String = ""
	Private vConcentracion As String = ""
	Private vFormaID As Integer = -1
	Private vFormaNombre As string =""
	Private vFormaSimpleId As Integer = -1
	Private vFormaSimpleNombre As string =""
	Private vPresentacion As String = ""
	Private vFracciones As Integer = -1
	Private vFechaRegistroSanitario As Long = 0
	Private vRegistroSanitario As String = ""
	Private vMarcaId As Integer = -1
	Private vMarcaNombre As string =""
	Private vGenerico As Integer = -1

	Public Property CatalogoId() As Integer
		Get
			Return vCatalogoId
		End Get
		Set(ByVal Value As Integer)
			vCatalogoId = Value
		End Set
	End Property

	Public Property Codigo() As String
		Get
			Return vCodigo
		End Get
		Set(ByVal Value As String)
			vCodigo = Value
		End Set
	End Property

	Public Property Nombre() As String
		Get
			Return vNombre
		End Get
		Set(ByVal Value As String)
			vNombre = Value
		End Set
	End Property

	Public Property Concentracion() As String
		Get
			Return vConcentracion
		End Get
		Set(ByVal Value As String)
			vConcentracion = Value
		End Set
	End Property

	Public Property FormaID() As Integer
		Get
			Return vFormaID
		End Get
		Set(ByVal Value As Integer)
			vFormaID = Value
		End Set
	End Property

	Public Property FormaNombre() as string
		Get
			Return vFormaNombre
		End Get
		Set(ByVal Value As string)
			vFormaNombre = Value
		End Set
	End Property

	Public Property FormaSimpleId() As Integer
		Get
			Return vFormaSimpleId
		End Get
		Set(ByVal Value As Integer)
			vFormaSimpleId = Value
		End Set
	End Property

	Public Property FormaSimpleNombre() as string
		Get
			Return vFormaSimpleNombre
		End Get
		Set(ByVal Value As string)
			vFormaSimpleNombre = Value
		End Set
	End Property

	Public Property Presentacion() As String
		Get
			Return vPresentacion
		End Get
		Set(ByVal Value As String)
			vPresentacion = Value
		End Set
	End Property

	Public Property Fracciones() As Integer
		Get
			Return vFracciones
		End Get
		Set(ByVal Value As Integer)
			vFracciones = Value
		End Set
	End Property

	Public Property FechaRegistroSanitario() As Long
		Get
			Return vFechaRegistroSanitario
		End Get
		Set(ByVal Value As Long)
			vFechaRegistroSanitario = Value
		End Set
	End Property

	Public readonly  Property FechaRegistroSanitarioStr() as string
		Get
			Return System.DateTime.FromFileTime(FechaRegistroSanitario).ToShortDateString
		End Get
	End Property

	Public Property RegistroSanitario() As String
		Get
			Return vRegistroSanitario
		End Get
		Set(ByVal Value As String)
			vRegistroSanitario = Value
		End Set
	End Property

	Public Property MarcaId() As Integer
		Get
			Return vMarcaId
		End Get
		Set(ByVal Value As Integer)
			vMarcaId = Value
		End Set
	End Property

	Public Property MarcaNombre() as string
		Get
			Return vMarcaNombre
		End Get
		Set(ByVal Value As string)
			vMarcaNombre = Value
		End Set
	End Property

	Public Property Generico() As Integer
		Get
			Return vGenerico
		End Get
		Set(ByVal Value As Integer)
			vGenerico = Value
		End Set
	End Property

	Sub New()
	End Sub

	Sub New(ByRef CatalogoId As Integer, ByVal Codigo As String, ByVal Nombre As String, ByVal Concentracion As String, ByVal FormaID As Integer, ByVal FormaSimpleId As Integer, ByVal Presentacion As String, ByVal Fracciones As Integer, ByVal FechaRegistroSanitario As Long, ByVal RegistroSanitario As String, ByVal MarcaId As Integer, ByVal Generico As Integer)
		vCatalogoId = CatalogoId
		vCodigo = Codigo
		vNombre = Nombre
		vConcentracion = Concentracion
		vFormaID = FormaID
		vFormaSimpleId = FormaSimpleId
		vPresentacion = Presentacion
		vFracciones = Fracciones
		vFechaRegistroSanitario = FechaRegistroSanitario
		vRegistroSanitario = RegistroSanitario
		vMarcaId = MarcaId
		vGenerico = Generico
	End Sub

End Class



 Public Class CatalogoCol   
 Inherits System.Collections.CollectionBase
Private _enmSortDirection As SortDirection
Public Sub New()
_enmSortDirection = SortDirection.Asc
End Sub
Public Sub Sort(ByVal sortExpression As String, ByVal sortDirection As SortDirection)
InnerList.Sort(New Comparer(sortExpression, SortDirection))
End Sub
Public Sub Sort(ByVal sortExpression As String)
InnerList.Sort(New Comparer(sortExpression, _enmSortDirection))
If _enmSortDirection = SortDirection.Asc Then
_enmSortDirection = SortDirection.Desc
Else
_enmSortDirection = SortDirection.Asc
End If
End Sub
Public Function Add(ByVal obj As Catalogo) As Integer
Return MyBase.List.Add(obj)
End Function
Public Sub AddPrimero(ByVal obj As Catalogo)
MyBase.List.Insert(0, obj)
End Sub
Public ReadOnly Property Catalogo(ByVal Index As Integer) As Catalogo
Get
Return CType(MyBase.List(Index), Catalogo)
End Get
End Property
End Class
end namespace

